package org.example.pageInterceptor.config;

import com.github.pagehelper.PageInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

@Configuration
public class MyBatisConfig {
    @Bean
    public PageInterceptor pageInterceptor() {
        PageInterceptor pageInterceptor = new PageInterceptor();
        Properties properties = new Properties();
        // 这里可以设置PageHelper相关参数，如果使用默认值可以不设置
        pageInterceptor.setProperties(properties);
        return pageInterceptor;
    }
}